<?php

namespace GamesBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @author  coffey  <coffey@nligo.com>
 * GameAwards
 *
 * 中奖记录表
 * @ORM\Table(name="game_awards")
 * @ORM\Entity(repositoryClass="GamesBundle\Repository\GameAwardsRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class GameAwards
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false,options={"comment":"游戏自增id"})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity="GameNperRecord")
     * @ORM\JoinColumn(name="game_nper_record_id", referencedColumnName="id")
     */
    private $GameNperRecordId;

    /**
     * @ORM\ManyToOne(targetEntity="GamesUserOrder")
     * @ORM\JoinColumn(name="order_id", referencedColumnName="id")
     */
    private $orderId;

    /**
     * @var integer
     *
     * @ORM\Column(name="create_at", type="integer", nullable=false,options={"comment":"创建时间"})
     */
    private $createAt = '0';

    /**
     * @ORM\PrePersist
     */
    public function PrePersist(){
        $this->setCreateAt(time());
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set createAt
     *
     * @param integer $createAt
     *
     * @return GameAwards
     */
    public function setCreateAt($createAt)
    {
        $this->createAt = $createAt;

        return $this;
    }

    /**
     * Get createAt
     *
     * @return integer
     */
    public function getCreateAt()
    {
        return $this->createAt;
    }

    /**
     * Set GameNperRecordId
     *
     * @param \GamesBundle\Entity\GameNperRecord $GameNperRecordId
     *
     * @return GameAwards
     */
    public function setGameNperRecordId(\GamesBundle\Entity\GameNperRecord $GameNperRecordId = null)
    {
        $this->GameNperRecordId = $GameNperRecordId;

        return $this;
    }

    /**
     * Get GameNperRecordId
     *
     * @return \GamesBundle\Entity\GameNperRecord
     */
    public function getGameNperRecordId()
    {
        return $this->GameNperRecordId;
    }

    /**
     * Set orderId
     *
     * @param \GamesBundle\Entity\GamesUserOrder $orderId
     *
     * @return GameAwards
     */
    public function setOrderId(\GamesBundle\Entity\GamesUserOrder $orderId = null)
    {
        $this->orderId = $orderId;

        return $this;
    }

    /**
     * Get orderId
     *
     * @return \GamesBundle\Entity\GamesUserOrder
     */
    public function getOrderId()
    {
        return $this->orderId;
    }
}
